import cv2

import numpy as np

img = cv2.imread('Resources/zy.jpg')
width,height = 500,500
pts1 = np.float32([[261,112],[574,139],[137,540],[630,589]])
pts2 = np.float32([[0,0],[width,0],[0,height],[width,height]])
matrix = cv2.getPerspectiveTransform(pts1,pts2)
imgOutput = cv2.warpPerspective(img,matrix,(width,height))

cv2.imshow('Origin',img)
cv2.imshow('Result',imgOutput)

cv2.waitKey(0)